{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Data Management"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Here we will discuss how we can set up the system to retrieve, store, load, and prepare the data for analysis. **If user wanted to go straight to compiling the historical data then the first 3 code chunks should be run to have directory setup then search \"Loading Data into Memory\" section where the DATA loading and updating will occur**"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Setting Up Directory"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We need to set up a couple directories\n",
    "\n",
    "- Root directory which will be the directory that these tutorials are held\n",
    "- Data directory \n",
    "- function directory"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Backtesting Basics.ipynb                      README.md\r\n",
      "Data_management.ipynb                         SPdates.R\r\n",
      "Definitions and Formulas.ipynb                S.R\r\n",
      "\u001b[0m\u001b[01;34mfunctions\u001b[0m/                                    \u001b[01;34mstockdata\u001b[0m/\r\n",
      "Intro to Strategies and Considerations.ipynb\r\n"
     ]
    }
   ],
   "source": [
    "%ls"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "%load_ext rpy2.ipython"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "%%R\n",
    "rootdir <- \"/home/ck1/Documents/Projects/Python/QuantTrade/\"\n",
    "datadir <- \"/home/ck1/Documents/Projects/Python/QuantTrade/stockdata/\"\n",
    "functiondir <- \"/home/ck1/Documents/Projects/Python/QuantTrade/functions/\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## URL Query Building"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "It seems that the Yahoo Stock Service has been closed. So we will use the `quantmod` or `Quandl` R package to extract some data... let's see how this works. We need to set up a function that will download all historical data from start to end date."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/usr/local/lib/python3.6/dist-packages/rpy2/rinterface/__init__.py:145: RRuntimeWarning: Loading required package: xts\n",
      "\n",
      "  warnings.warn(x, RRuntimeWarning)\n",
      "/usr/local/lib/python3.6/dist-packages/rpy2/rinterface/__init__.py:145: RRuntimeWarning: Loading required package: zoo\n",
      "\n",
      "  warnings.warn(x, RRuntimeWarning)\n",
      "/usr/local/lib/python3.6/dist-packages/rpy2/rinterface/__init__.py:145: RRuntimeWarning: \n",
      "Attaching package: ‘zoo’\n",
      "\n",
      "\n",
      "  warnings.warn(x, RRuntimeWarning)\n",
      "/usr/local/lib/python3.6/dist-packages/rpy2/rinterface/__init__.py:145: RRuntimeWarning: The following objects are masked from ‘package:base’:\n",
      "\n",
      "    as.Date, as.Date.numeric\n",
      "\n",
      "\n",
      "  warnings.warn(x, RRuntimeWarning)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "        Date    Open    High     Low   Close  Volume Ex-Dividend Split Ratio\n",
       "1 2018-01-18 1139.35 1140.59 1124.46 1135.97 1333633           0           1\n",
       "2 2018-01-17 1136.36 1139.32 1123.49 1139.10 1353097           0           1\n",
       "3 2018-01-16 1140.31 1148.88 1126.66 1130.70 1783881           0           1\n",
       "4 2018-01-12 1110.10 1131.30 1108.01 1130.65 1914460           0           1\n",
       "5 2018-01-11 1112.31 1114.85 1106.48 1111.88 1102461           0           1\n",
       "6 2018-01-10 1107.00 1112.78 1103.98 1110.14 1027781           0           1\n",
       "  Adj. Open Adj. High Adj. Low Adj. Close Adj. Volume\n",
       "1   1139.35   1140.59  1124.46    1135.97     1333633\n",
       "2   1136.36   1139.32  1123.49    1139.10     1353097\n",
       "3   1140.31   1148.88  1126.66    1130.70     1783881\n",
       "4   1110.10   1131.30  1108.01    1130.65     1914460\n",
       "5   1112.31   1114.85  1106.48    1111.88     1102461\n",
       "6   1107.00   1112.78  1103.98    1110.14     1027781\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%%R\n",
    "# using Quandl\n",
    "library(Quandl) # load the library\n",
    "Quandl.api_key(\"NcNrBJn7i4MR4k3u8D1t\") # This is the Quandl API_key that they give you\n",
    "GOOGLqd <- Quandl(\"WIKI/GOOGL\")\n",
    "head(GOOGLqd) # this gets us from the most current to the latest information"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/usr/local/lib/python3.6/dist-packages/rpy2/rinterface/__init__.py:145: RRuntimeWarning: Loading required package: TTR\n",
      "\n",
      "  warnings.warn(x, RRuntimeWarning)\n",
      "/usr/local/lib/python3.6/dist-packages/rpy2/rinterface/__init__.py:145: RRuntimeWarning: Version 0.4-0 included new data defaults. See ?getSymbols.\n",
      "Learn from a quantmod author: https://www.datacamp.com/courses/importing-and-managing-financial-data-in-r\n",
      "\n",
      "  warnings.warn(x, RRuntimeWarning)\n",
      "/usr/local/lib/python3.6/dist-packages/rpy2/rinterface/__init__.py:145: RRuntimeWarning: ‘getSymbols’ currently uses auto.assign=TRUE by default, but will\n",
      "use auto.assign=FALSE in 0.5-0. You will still be able to use\n",
      "‘loadSymbols’ to automatically load data. getOption(\"getSymbols.env\")\n",
      "and getOption(\"getSymbols.auto.assign\") will still be checked for\n",
      "alternate defaults.\n",
      "\n",
      "This message is shown once per session and may be disabled by setting \n",
      "options(\"getSymbols.warning4.0\"=FALSE). See ?getSymbols for details.\n",
      "\n",
      "  warnings.warn(x, RRuntimeWarning)\n",
      "/usr/local/lib/python3.6/dist-packages/rpy2/rinterface/__init__.py:145: RRuntimeWarning: \n",
      "WARNING: There have been significant changes to Yahoo Finance data.\n",
      "Please see the Warning section of ‘?getSymbols.yahoo’ for details.\n",
      "\n",
      "This message is shown once per session and may be disabled by setting\n",
      "options(\"getSymbols.yahoo.warning\"=FALSE).\n",
      "\n",
      "  warnings.warn(x, RRuntimeWarning)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "           GOOGL.Open GOOGL.High GOOGL.Low GOOGL.Close GOOGL.Volume\n",
       "2007-01-03   233.2332   238.5686  230.7858    234.0290     15397500\n",
       "2007-01-04   234.7347   242.2172  234.4094    241.8719     15759400\n",
       "2007-01-05   241.4915   243.9940  239.2943    243.8388     13730400\n",
       "2007-01-08   244.0891   245.1802  241.3413    242.0320      9499200\n",
       "2007-01-09   242.9680   244.3694  240.8408    242.9930     10752000\n",
       "2007-01-10   242.4575   247.0220  241.2613    244.9750     11925000\n",
       "           GOOGL.Adjusted\n",
       "2007-01-03       234.0290\n",
       "2007-01-04       241.8719\n",
       "2007-01-05       243.8388\n",
       "2007-01-08       242.0320\n",
       "2007-01-09       242.9930\n",
       "2007-01-10       244.9750\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%%R\n",
    "#using quantmod\n",
    "library(quantmod)\n",
    "getSymbols(\"GOOGL\",src=\"yahoo\") \n",
    "head(GOOGL)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now it seems that the quantmod does a much faster job in downloading the data... let's see if that is truly the case"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Unit: milliseconds\n",
       "                 expr       min        lq      mean    median        uq\n",
       "  getSymbols(\"GOOGL\")  198.9669  211.2992  308.1043  336.8403  341.8566\n",
       " Quandl(\"WIKI/GOOGL\") 1145.3463 1198.0748 1461.9387 1345.7439 1583.2712\n",
       "       max neval cld\n",
       "  451.5585     5  a \n",
       " 2037.2574     5   b\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%%R\n",
    "\n",
    "# Here is a check on which function is faster in loading data\n",
    "library(quantmod)\n",
    "library(microbenchmark)\n",
    "microbenchmark(\n",
    "  getSymbols(\"GOOGL\"),\n",
    "  Quandl(\"WIKI/GOOGL\"),\n",
    "    times = 5\n",
    ")\n",
    "\n",
    "# faster way to load the above code is to vectorize the process and save accordingly\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can see that the quantmod function does a 4x times faster job... so we'll go with quantmod method :)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Data Acquisition"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now we want to fetch a list of desired stocks... we will start with S&P 500. The `url` below has S&P 500 stock ticker stored as a list of character data. We will save it as an object `S`"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "%%R\n",
    "\n",
    "url <- \"http://trading.chrisconlan.com/SPstocks.csv\"\n",
    "S <- as.character(read.csv(url,header=FALSE)[,1])\n",
    "setwd(rootdir)\n",
    "dump(list=\"S\",\"S.R\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now we create a workflow that will download all of of the S&P data into the folder given that the ticker is in the S file if not then it will be inside the initial root directory."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "%%R\n",
    "\n",
    "# create function that will extract the closing price into dataframe\n",
    "qmfunc <- function(sym, from=\"2000-01-01\"){\n",
    "  library(data.table)\n",
    "  tryCatch(\n",
    "    suppressWarnings(\n",
    "    getSymbols(sym, from = from, env = globalenv())),\n",
    "    error = function(e) NULL\n",
    "  )\n",
    "}\n",
    "setwd(functiondir)\n",
    "dump(list=c(\"qmfunc\"), \"qmfunc.R\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "%%R\n",
    "\n",
    "#load \"invalid.R\" file if available\n",
    "invalid <- character(0)\n",
    "setwd(rootdir)\n",
    "if(\"invalid.R\" %in% list.files()) source(\"invalid.R\")\n",
    "\n",
    "# find all symbols not in directory and not missing\n",
    "setwd(datadir)\n",
    "toload <- setdiff(S[!paste0(S, \".csv\") %in% list.files()], invalid) # we only make a list for those to load"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now we can optimize the above code by using the `mclapply` function with the help of `parallel` package"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/usr/local/lib/python3.6/dist-packages/rpy2/rinterface/__init__.py:145: RRuntimeWarning: data.table 1.10.4.2\n",
      "\n",
      "  warnings.warn(x, RRuntimeWarning)\n",
      "/usr/local/lib/python3.6/dist-packages/rpy2/rinterface/__init__.py:145: RRuntimeWarning:   The fastest way to learn (by data.table authors): https://www.datacamp.com/courses/data-analysis-the-data-table-way\n",
      "\n",
      "  warnings.warn(x, RRuntimeWarning)\n",
      "/usr/local/lib/python3.6/dist-packages/rpy2/rinterface/__init__.py:145: RRuntimeWarning:   Documentation: ?data.table, example(data.table) and browseVignettes(\"data.table\")\n",
      "\n",
      "  warnings.warn(x, RRuntimeWarning)\n",
      "/usr/local/lib/python3.6/dist-packages/rpy2/rinterface/__init__.py:145: RRuntimeWarning:   Release notes, videos and slides: http://r-datatable.com\n",
      "\n",
      "  warnings.warn(x, RRuntimeWarning)\n",
      "/usr/local/lib/python3.6/dist-packages/rpy2/rinterface/__init__.py:145: RRuntimeWarning: \n",
      "Attaching package: ‘data.table’\n",
      "\n",
      "\n",
      "  warnings.warn(x, RRuntimeWarning)\n",
      "/usr/local/lib/python3.6/dist-packages/rpy2/rinterface/__init__.py:145: RRuntimeWarning: The following objects are masked from ‘package:xts’:\n",
      "\n",
      "    first, last\n",
      "\n",
      "\n",
      "  warnings.warn(x, RRuntimeWarning)\n"
     ]
    }
   ],
   "source": [
    "%%R\n",
    "library(parallel)\n",
    "\n",
    "if(length(toload)!=0){\n",
    "    \n",
    "    # Function for extracting all of the stickers into the R environment\n",
    "    mclapply(1:length(S),\n",
    "         function(i) {\n",
    "             qmfunc(S[[i]])\n",
    "         })\n",
    "    \n",
    "    # Function to save the tickers that have been stored into csv file\n",
    "    for(i in 1:length(intersect(S,ls()))){\n",
    "        df <- data.frame(Date=index(get(intersect(S,ls())[i])), coredata(get(intersect(S,ls())[i])))\n",
    "        names(df) <- c(\"Date\",\"Open\",\"High\",\"Low\",\"Close\",\"Volume\",\"Adj Close\")\n",
    "        fwrite(x = df, file = paste0(intersect(S,ls())[i],\".csv\"), row.names = FALSE)\n",
    "    }\n",
    "    \n",
    "    # Function to include all tickers that haven't been downloaded\n",
    "    for(i in 1:length(setdiff(S,intersect(S,ls())))){\n",
    "        invalid <- c(invalid, setdiff(S,intersect(S,ls()))[i])\n",
    "    }\n",
    "    \n",
    "}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We've successfully saved all the stock data (of interest) into our folder and now need to remove objects from the environment except for path variables and functions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "          used (Mb) gc trigger  (Mb) max used  (Mb)\n",
       "Ncells 1219368 65.2    2164898 115.7  1928506 103.0\n",
       "Vcells 1829998 14.0   17228173 131.5 21535134 164.4\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%%R\n",
    "rm(list = setdiff(ls(), c(\"rootdir\", \"functiondir\", \"datadir\", \"yahoo\",\"qmfunc\")))\n",
    "gc()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Loading Data Into Memory"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now that all the data file is stored in the `datadir`, we need to use the `data.table` library `fread()` function which has a faster speed compared to `read.csv`of the `base` package of `R`"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/usr/local/lib/python3.6/dist-packages/rpy2/rinterface/__init__.py:145: RRuntimeWarning: data.table 1.10.4.2\n",
      "\n",
      "  warnings.warn(x, RRuntimeWarning)\n",
      "/usr/local/lib/python3.6/dist-packages/rpy2/rinterface/__init__.py:145: RRuntimeWarning:   The fastest way to learn (by data.table authors): https://www.datacamp.com/courses/data-analysis-the-data-table-way\n",
      "\n",
      "  warnings.warn(x, RRuntimeWarning)\n",
      "/usr/local/lib/python3.6/dist-packages/rpy2/rinterface/__init__.py:145: RRuntimeWarning:   Documentation: ?data.table, example(data.table) and browseVignettes(\"data.table\")\n",
      "\n",
      "  warnings.warn(x, RRuntimeWarning)\n",
      "/usr/local/lib/python3.6/dist-packages/rpy2/rinterface/__init__.py:145: RRuntimeWarning:   Release notes, videos and slides: http://r-datatable.com\n",
      "\n",
      "  warnings.warn(x, RRuntimeWarning)\n"
     ]
    }
   ],
   "source": [
    "%%R\n",
    "\n",
    "setwd(datadir)\n",
    "S <- sub(\".csv\", \"\", list.files())\n",
    "library(data.table)\n",
    "DATA <- list()\n",
    "for(i in S) {\n",
    "    suppressWarnings(\n",
    "    DATA[[i]] <- fread(paste0(i, \".csv\"), sep = \",\"))\n",
    "    DATA[[i]] <- (DATA[[i]])[order(DATA[[i]][[\"Date\"]], decreasing = FALSE)]\n",
    "}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Updating Data"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now we need to make sure the data is up to date by checking most recent date of each symbol. Yahoo finance API updates at about 8:00 pm EST after each trading day. This is 44 hours away from midnight the day before (24 + 20 = 44). But based on [This](https://stackoverflow.com/questions/22380475/when-yahoo-historical-quotes-gets-updated-daily) response, it seems that the final stocks that get updated are around 9:00 pm EST. Thus based on this we can check if the difference between the most recent time in our data and the current time is greater than 44 we can update the data. Since I am in Mountain Time, we need to set the `Sys.setenv(TZ='EST')`. Also we need to make sure that we are not updating on weekends. We basically do not want to unnecessary call the R function when it is in fact the weekend."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The below code takes so long... I would optimize it but there is another line of code below that will use Yahoo Query Language with a much faster update speed so... Probably shouldn't bother running the below code :)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "#%%R\n",
    "#\n",
    "#Sys.setenv(TZ='EST')\n",
    "#currentTime <- Sys.time()\n",
    "\n",
    "#for(i in S){\n",
    " # # Store greatest date within DATA for symbol i\n",
    " # maxdate <- DATA[[i]][[\"Date\"]][nrow(DATA[[i]])]\n",
    " # if(as.numeric(difftime(currentTime, maxdate, units = \"hours\")) >= 45){\n",
    "    \n",
    " #   # Push the maxdate forward one day\n",
    " #   maxdate <- strptime(as.POSIXct(maxdate), \"%Y-%m-%d\") + 86400\n",
    " #   \n",
    " #   weekend <- sum(c(\"Saturday\", \"Sunday\") %in% weekdays(c(as.POSIXct(maxdate), currentTime))) == 2\n",
    " #   \n",
    " #   span <- FALSE\n",
    " #   \n",
    " #   if( weekend ){\n",
    " #     span <- as.numeric(difftime(currentTime, maxdate, units = \"hours\"))\n",
    " #   }\n",
    " #   if(!weekend & !span){\n",
    " #     qmfunc(i, from = maxdate)\n",
    " #     \n",
    " #     if(i %in% ls()){\n",
    " #       if(all(!is.na(get(i))) & nrow(get(i)) > 0){\n",
    " #         get(i) <- get(i)[nrow(get(i)):1,]\n",
    " #         write.table(get(i), file = paste0(i,\".csv\"), sep = \",\", row.names = FALSE, col.names = FALSE, append = TRUE)\n",
    " #         DATA[[i]] <- rbind(DATA[[i]], get(i))\n",
    " #       }\n",
    " #     }\n",
    " #   }\n",
    " # }\n",
    "#}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Another way we can update the daily stock is to use the Yahoo Query Language (YQL), which is a MySQL-style API that allows for output of the data into XML, HTML, and JSON. Something to note is that Yahoo will throw an error if we request more than 15 tradying days at one time in batches of 101 stocks, so we will only request 1 day worth of 101 stocks (5 batches: 5 x 101 = 505). "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[1] \"http://query.yahooapis.com/v1/public/yql?q=select * from yahoo.finance.historicaldata where symbol in ( 'YHOO', 'GOOGL') and startDate = '2014-01-01' and endDate = '2014-12-31'&diagnostics=true&env=store://datatables.org/alltableswithkeys\"\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%%R\n",
    "\n",
    "base <- \"http://query.yahooapis.com/v1/public/yql?\"\n",
    "begQuery <- \"q=select * from yahoo.finance.historicaldata where symbol in \"\n",
    "midQuery <- \"( 'YHOO', 'GOOGL') \"\n",
    "endQuery <- \"and startDate = '2014-01-01' and endDate = '2014-12-31'\"\n",
    "endParams <- \"&diagnostics=true&env=store://datatables.org/alltableswithkeys\"\n",
    "urlstr <- paste0 (base, begQuery, midQuery, endQuery, endParams)\n",
    "urlstr"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The URL string will result in an XML page if you copy paste it :) Now we need to use the `XML` package to parse through the data and update "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/usr/local/lib/python3.6/dist-packages/rpy2/rinterface/__init__.py:145: RRuntimeWarning: \n",
      "Attaching package: ‘XML’\n",
      "\n",
      "\n",
      "  warnings.warn(x, RRuntimeWarning)\n",
      "/usr/local/lib/python3.6/dist-packages/rpy2/rinterface/__init__.py:145: RRuntimeWarning: The following object is masked from ‘package:tools’:\n",
      "\n",
      "    toHTML\n",
      "\n",
      "\n",
      "  warnings.warn(x, RRuntimeWarning)\n"
     ]
    }
   ],
   "source": [
    "%%R\n",
    "\n",
    "setwd(datadir)\n",
    "library(XML)\n",
    "\n",
    "currentTime <- Sys.time()\n",
    "\n",
    "batchsize <- 101\n",
    "\n",
    "\n",
    "# i in 1:5 for this example\n",
    "for(i in 1:(ceiling(length(S) / batchsize)) ){\n",
    "  \n",
    "  midQuery <- \" (\"\n",
    "  maxdate <- character(0)\n",
    "  \n",
    "  startIndex <- ((i - 1) * batchsize + 1) \n",
    "  endIndex <- min(i * batchsize, length(S))\n",
    "  \n",
    "  # find earliest date and build query\n",
    "  for(s in S[startIndex:(endIndex - 1)]){\n",
    "    maxdate <- c(maxdate, DATA[[s]][[1]][nrow(DATA[[s]])])\n",
    "    midQuery <- paste0(midQuery, \"'\", s, \"', \")\n",
    "  }\n",
    "  maxdate <- c(maxdate, DATA[[S[endIndex]]][[1]][nrow(DATA[[S[endIndex]]])])\n",
    "  startDate <- max(maxdate)\n",
    "  \n",
    "  if( startDate <\n",
    "      substr(strptime(substr(currentTime, 0, 10), \"%Y-%m-%d\") - 28 * 86400, 0, 10)){\n",
    "    cat(\"Query is greater than 20 trading days. Download with csv method.\")\n",
    "    break\n",
    "  }\n",
    "  \n",
    "  # Add a day (86400 seconds) to the earliest date to avoid duplicates\n",
    "  startDate <- substr(as.character(strptime(startDate, \"%Y-%m-%d\") + 86400), 0, 10)\n",
    "  endDate <- substr(currentTime, 0, 10)\n",
    "  \n",
    "  # Yahoo! updates at 4:15 EST at earliest, check if it is part 4:15 day after last\n",
    "  isUpdated <- as.numeric(difftime(currentTime, startDate, units = \"hours\")) >= 45\n",
    "  \n",
    "  # If both days fall in the same weekend, we won't attemp tto update\n",
    "  weekend <- sum(c(\"Saturday\", \"Sunday\") %in% weekdays(c(strptime(endDate, \"%Y-%m-%d\"), c(strptime(startDate, \"%Y-%m-%d\"))))) == 2 \n",
    "  \n",
    "  span <- FALSE\n",
    "  if( weekend ){\n",
    "    span <- as.numeric(difftime(currentTime, startDate, units = \"hours\")) < 48\n",
    "  }\n",
    "  if( startDate <= endDate & !weekend & !span & isUpdated){\n",
    "    # Given the condition that there is updatable data\n",
    "    base <- \"http://query.yahooapis.com/v1/public/yql?\"\n",
    "    begQuery <- \"q=select * from yahoo.finance.historicaldata where symbol in \"\n",
    "    midQuery <- paste0(midQuery, \"'\", S[min(i * batchsize, length(S))], \"') \")\n",
    "    endQuery <- paste0(\"and startDate = '\", startDate, \"' and endDate = '\", endDate, \"'\")\n",
    "    endParams <- \"&diagnostics=true&env=store://datatables.org/alltableswithkeys\"\n",
    "    \n",
    "    urlstr <- paste0(base, begQuery, midQuery, endQuery, endParams)\n",
    "    \n",
    "    # Fetch data and arrange in XML tree\n",
    "    \n",
    "    doc <- xmlParse(urlstr)\n",
    "    \n",
    "    # Below lines rely on XPath and quirks of S4 objects in XML package in R. \n",
    "    \n",
    "    df <- getNodeSet(doc, c(\"//query/results/quote\"),\n",
    "                     fun = function(v) xpathSApply(v,\n",
    "                                                   c(\"./Date\",\n",
    "                                                     \"./Open\",\n",
    "                                                     \"./High\",\n",
    "                                                     \"./Low\",\n",
    "                                                     \"./Close\",\n",
    "                                                     \"./Volume\",\n",
    "                                                     \"./Adj_Close\"),\n",
    "                                                   xmlValue))\n",
    "    \n",
    "    # If the URL did find data, we organize and update\n",
    "    if(length(df) != 0){\n",
    "      #we get attributes from the same tree, which happen to be dates we need\n",
    "      symbols <- unname(sapply(\n",
    "        getNodeSet(doc, c(\"//query/results/quote\")), xmlAttrs))\n",
    "      \n",
    "      df <- cbind(symbols, data.frame(t(data.frame(df, stringAsFactors = FALSE)),\n",
    "                                      stringAsFactors = FALSE, row.names = NULL))\n",
    "      \n",
    "      names(df) <- c(\"Symbol\",\"Date\",\"Open\",\"High\",\"Low\",\"Close\",\"Volume\",\"Adj Close\")\n",
    "      \n",
    "      df[,3:8] <- lapply(df[,3:8], as.numeric)\n",
    "      df <- df[order(df[,1], decreasing = FALSE),]\n",
    "      \n",
    "      sym <- as.character(unique(df$Symbol))\n",
    "      \n",
    "      for(s in sym){\n",
    "        \n",
    "        temp <- df[df$Symbol == s, 2:8]\n",
    "        temp <- temp[order(temp[,1], decreasing = FALSE),]\n",
    "        \n",
    "        startDate <- DATA[[s]][[\"Date\"]][nrow(DATA[[s]])]\n",
    "        \n",
    "        DATA[[s]] <- DATA[[s]][order(DATA[[s]][[1]], decreasing = FALSE)]\n",
    "        DATA[[s]] <- rbind(DATA[[s]], temp[temp$Date > startDate, ])\n",
    "        write.table(DATA[[s]][DATA[[s]][[\"Date\"]] > startDate],\n",
    "                    file = paste0(s, \".csv\"), sep = \",\",\n",
    "                    row.names = FALSE, col.names = FALSE, append = TRUE)\n",
    "      }\n",
    "    }\n",
    "  }\n",
    "}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Organizing as Date-Uniform `zoo` Object"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now we want our platform to pull data and run strategies for many symbols in different countries thus we need to make sure the dates line up and account for days off in each respective country."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "         Date     Open     High      Low    Close Volume Adj Close\n",
       "1: 2001-11-29 13.38667 14.46667 13.36000 13.88000 371100  13.25355\n",
       "2: 2001-11-30 13.88000 14.26667 13.88000 14.26667 165300  13.62276\n",
       "3: 2001-12-03 14.23333 14.23333 13.78333 13.78333 127500  13.16124\n",
       "4: 2001-12-04 13.78333 13.78333 13.23333 13.23333  95400  12.63607\n",
       "5: 2001-12-05 13.43333 14.78333 13.43333 14.66667 598200  14.00470\n",
       "6: 2001-12-06 14.73333 14.73333 14.57000 14.57333 157200  13.91559\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%%R\n",
    "head(DATA[[\"AAP\"]])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/usr/local/lib/python3.6/dist-packages/rpy2/rinterface/__init__.py:145: RRuntimeWarning: \n",
      "Attaching package: ‘zoo’\n",
      "\n",
      "\n",
      "  warnings.warn(x, RRuntimeWarning)\n",
      "/usr/local/lib/python3.6/dist-packages/rpy2/rinterface/__init__.py:145: RRuntimeWarning: The following objects are masked from ‘package:base’:\n",
      "\n",
      "    as.Date, as.Date.numeric\n",
      "\n",
      "\n",
      "  warnings.warn(x, RRuntimeWarning)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "5.3% Complete\n",
       "10.7% Complete\n",
       "16% Complete\n",
       "21.3% Complete\n",
       "26.7% Complete\n",
       "32% Complete\n",
       "37.3% Complete\n",
       "42.6% Complete\n",
       "48% Complete\n",
       "53.3% Complete\n",
       "58.6% Complete\n",
       "64% Complete\n",
       "69.3% Complete\n",
       "74.6% Complete\n",
       "80% Complete\n",
       "85.3% Complete\n",
       "90.6% Complete\n",
       "95.9% Complete\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%%R\n",
    "\n",
    "library(zoo)\n",
    "\n",
    "# compute date template as column of date.frame for merging\n",
    "# considers date are strings in YYY-MM-DD format\n",
    "\n",
    "datetemp <- sort(unique(unlist(sapply(DATA, function(v) v[[\"Date\"]]))))\n",
    "datetemp <- data.frame(datetemp, stringsAsFactors = FALSE)\n",
    "names(datetemp) <- \"Date\"\n",
    "                                      \n",
    "# Double chck the data is unique and in ascending-date order\n",
    "DATA <- lapply(DATA, function(v) unique(v[order(v$Date),]))\n",
    "\n",
    "# Create 6 new objects that will hold re-organized data\n",
    "DATA[[\"Open\"]] <- DATA[[\"High\"]] <- DATA[[\"Low\"]] <- DATA[[\"Close\"]] <- DATA[[\"Adj Close\"]] <- DATA[[\"Volume\"]] <- datetemp\n",
    "\n",
    "# This loop will sequentially append new columns of each symbol to appropriate Open, High, Low, etc obj\n",
    "    \n",
    "for(s in S){\n",
    "    for(i in rev(c(\"Open\",\"High\",\"Low\",\"Close\",\"Adj Close\",\"Volume\"))){\n",
    "        temp <- data.frame(cbind(DATA[[s]][[\"Date\"]], DATA[[s]][[i]]),\n",
    "                          stringsAsFactors = FALSE)\n",
    "        names(temp) <- c(\"Date\", s)\n",
    "        temp[,2] <- as.numeric(temp[,2])\n",
    "        \n",
    "        if(!any(!DATA[[i]][[\"Date\"]][(nrow(DATA[[i]]) - nrow(temp)+1):nrow(DATA[[i]])] == temp[,1])){\n",
    "            temp <- rbind(t(matrix(nrow = 2, ncol = nrow(DATA[[i]]) - nrow(temp), dimnames = list(names(temp)))), temp)\n",
    "            DATA[[i]] <- cbind(DATA[[i]], temp[,2])\n",
    "        } else {\n",
    "            DATA[[i]]\n",
    "            DATA[[i]] <- merge(DATA[[i]], temp, all.v = TRUE, by = \"Date\")\n",
    "        }\n",
    "        \n",
    "        names(DATA[[i]]) <- c(names(DATA[[i]])[-(ncol(DATA[[i]]))], s)\n",
    "    }\n",
    "    DATA[[s]] <- NULL\n",
    "    \n",
    "    # Update user on progress\n",
    "    if( which(S == s) %% 25 ==0){\n",
    "        cat(paste0(round(100 * which(S == s) / length(S), 1), \"% Complete\\n\"))\n",
    "    }\n",
    "}\n",
    "# Declare them as zoo objects for use with time-series functions\n",
    "DATA <- lapply(DATA, function(v) zoo(v[,2:ncol(v)], strptime(v[,1], \"%Y-%m-%d\")))\n",
    "# Remove extra vars\n",
    "rm(list = setdiff(ls(), c(\"DATA\", \"datadir\", \"functiondir\", \"rootdir\")))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Time to check the data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "List of 6\n",
       " $ Volume   :‘zoo’ series from 2000-01-03 to 2018-01-17\n",
       "  Data: num [1:4539, 1:469] 4674300 4765000 5758600 2534400 2819600 ...\n",
       "  ..- attr(*, \"dimnames\")=List of 2\n",
       "  .. ..$ : NULL\n",
       "  .. ..$ : chr [1:469] \"A\" \"AA\" \"AAL\" \"AAP\" ...\n",
       "  Index:  POSIXlt[1:4539], format: \"2000-01-03\" \"2000-01-04\" ...\n",
       " $ Adj Close:‘zoo’ series from 2000-01-03 to 2018-01-17\n",
       "  Data: num [1:4539, 1:469] 45.7 42.2 39.6 38.1 41.3 ...\n",
       "  ..- attr(*, \"dimnames\")=List of 2\n",
       "  .. ..$ : NULL\n",
       "  .. ..$ : chr [1:469] \"A\" \"AA\" \"AAL\" \"AAP\" ...\n",
       "  Index:  POSIXlt[1:4539], format: \"2000-01-03\" \"2000-01-04\" ...\n",
       " $ Close    :‘zoo’ series from 2000-01-03 to 2018-01-17\n",
       "  Data: num [1:4539, 1:469] 51.5 47.6 44.6 42.9 46.5 ...\n",
       "  ..- attr(*, \"dimnames\")=List of 2\n",
       "  .. ..$ : NULL\n",
       "  .. ..$ : chr [1:469] \"A\" \"AA\" \"AAL\" \"AAP\" ...\n",
       "  Index:  POSIXlt[1:4539], format: \"2000-01-03\" \"2000-01-04\" ...\n",
       " $ Low      :‘zoo’ series from 2000-01-03 to 2018-01-17\n",
       "  Data: num [1:4539, 1:469] 48.2 46.3 43.1 41.6 42.2 ...\n",
       "  ..- attr(*, \"dimnames\")=List of 2\n",
       "  .. ..$ : NULL\n",
       "  .. ..$ : chr [1:469] \"A\" \"AA\" \"AAL\" \"AAP\" ...\n",
       "  Index:  POSIXlt[1:4539], format: \"2000-01-03\" \"2000-01-04\" ...\n",
       " $ High     :‘zoo’ series from 2000-01-03 to 2018-01-17\n",
       "  Data: num [1:4539, 1:469] 56.5 49.3 47.6 44.3 47.2 ...\n",
       "  ..- attr(*, \"dimnames\")=List of 2\n",
       "  .. ..$ : NULL\n",
       "  .. ..$ : chr [1:469] \"A\" \"AA\" \"AAL\" \"AAP\" ...\n",
       "  Index:  POSIXlt[1:4539], format: \"2000-01-03\" \"2000-01-04\" ...\n",
       " $ Open     :‘zoo’ series from 2000-01-03 to 2018-01-17\n",
       "  Data: num [1:4539, 1:469] 56.3 48.7 47.4 44.1 42.2 ...\n",
       "  ..- attr(*, \"dimnames\")=List of 2\n",
       "  .. ..$ : NULL\n",
       "  .. ..$ : chr [1:469] \"A\" \"AA\" \"AAL\" \"AAP\" ...\n",
       "  Index:  POSIXlt[1:4539], format: \"2000-01-03\" \"2000-01-04\" ...\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%%R\n",
    "str(DATA)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Data Preparation"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now that we have a list of 6 zoo objects (i.e. relevant measures of our stock) we need to focus our efforts on these things:\n",
    "- Clean data for optimizing analysis\n",
    "- Compute new dataset for analysis"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##  Handling NA Values"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### NA vs NaN in R"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$ \\frac{a}{0} = Inf, \\frac{0}{0} = NaN, \\frac{-a}{0} = -Inf$ "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### IPOs and Additions to S&P 500"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Let's take a look at the stock ticker `KORS` they should have some NA values because they don't quite have the Pre-IPO data. The S&P500 requires that companies have a minimum of $5.3 billion minimum market capitalization therefore `KORS` do not have any data pre-S&P500."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/usr/local/lib/python3.6/dist-packages/rpy2/rinterface/__init__.py:145: RRuntimeWarning: \n",
      "Attaching package: ‘dplyr’\n",
      "\n",
      "\n",
      "  warnings.warn(x, RRuntimeWarning)\n",
      "/usr/local/lib/python3.6/dist-packages/rpy2/rinterface/__init__.py:145: RRuntimeWarning: The following objects are masked from ‘package:data.table’:\n",
      "\n",
      "    between, first, last\n",
      "\n",
      "\n",
      "  warnings.warn(x, RRuntimeWarning)\n",
      "/usr/local/lib/python3.6/dist-packages/rpy2/rinterface/__init__.py:145: RRuntimeWarning: The following objects are masked from ‘package:stats’:\n",
      "\n",
      "    filter, lag\n",
      "\n",
      "\n",
      "  warnings.warn(x, RRuntimeWarning)\n",
      "/usr/local/lib/python3.6/dist-packages/rpy2/rinterface/__init__.py:145: RRuntimeWarning: The following objects are masked from ‘package:base’:\n",
      "\n",
      "    intersect, setdiff, setequal, union\n",
      "\n",
      "\n",
      "  warnings.warn(x, RRuntimeWarning)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "2011-12-12 2011-12-13 2011-12-14 2011-12-15 2011-12-16 2011-12-19 \n",
       "        NA         NA         NA      25.00      24.45      24.50 \n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%%R\n",
    "\n",
    "library(dplyr)\n",
    "\n",
    "subset(DATA$Open$KORS, index(DATA$Open) >= \"2011-12-11\" & index(DATA$Open) <= \"2011-12-19\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now we need to get rid of the Pre-S&P Data with regards to having them just be `NA` values. any time before 1/1/2000 will be regarded as such."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "%%R\n",
    "\n",
    "setwd(rootdir)\n",
    "if(\"SPdates.R\" %in% list.files()){\n",
    "    source(\"SPdates.R\")\n",
    "} else {\n",
    "    url <- \"http://trading.chrisconlan.com/SPdates.csv\"\n",
    "    S <- read.csv(url, header = FALSE, stringsAsFactors = FALSE)\n",
    "    dump(list = \"S\", \"SPdates.R\")\n",
    "} \n",
    "names(S) <- c(\"Symbol\", \"Date\")\n",
    "S$Date <- strptime(S$Date, \"%m/%d/%Y\")\n",
    "for(s in names(DATA[[\"Close\"]])) {\n",
    "    for(i in c(\"Open\", \"High\", \"Low\", \"Close\",\"Adj Close\",\"Volume\")){\n",
    "        Sindex <- which(S[,1] ==s)\n",
    "        if(S[Sindex, \"Date\"] != \"1900-01-01 EST\" & S[Sindex, \"Date\"] >=\"2000-01-01 EST\"){\n",
    "            DATA[[i]][index(DATA[[i]]) <= S[Sindex, \"Date\"], s] <- NA\n",
    "        }\n",
    "    }\n",
    "}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Merging to the Uniform Data Template"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Since there will be many stocks traded internationally, there would be missing values in nonoverlapping trading days (i.e. a friday in U.S. would be a saturday in Japan thus there would be NA in Japane for that day). So in order to address this we need to go through these:\n",
    "- Forward replacement (in statistics this would be a carry last observation forward)\n",
    "- Linearly smoothed replacement (i.e. linear line from previous to current)\n",
    "- Volume-weighted smoothed replacement (i.e. two nearest points in linearly smoothed replacement and weights by volume of nearest non-missing days)\n",
    "- Do nothing\n",
    "\n",
    "Let's use the 10-day period of `KORS` where we pretend we need to fill in prices on Thanksgiving 2016 and the following Black Friday weekend."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "%%R\n",
    "\n",
    "# create temporary data\n",
    "temp <- c(DATA[[\"Close\"]][index(DATA[[\"Close\"]]) %in% c(\"2016-11-21\", \"2016-11-22\",\"2016-11-23\"), \"KORS\"],\n",
    "         zoo(NA, order.by = strptime(\"2016-11-24\", \"%Y-%m-%d\")),\n",
    "         DATA[[\"Close\"]][index(DATA[[\"Close\"]]) %in% c(\"2016-11-25\"), \"KORS\"],\n",
    "         zoo(NA, order.by = strptime(c(\"2016-11-26\", \"2016-11-27\"), \"%Y-%m-%d\")),\n",
    "          DATA[[\"Close\"]][index(DATA[[\"Close\"]]) %in% c(\"2016-11-28\",\"2016-11-29\",\"2016-11-30\"), \"KORS\"])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##  Forward Replacement (aka last observation carried forward)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Forward replacement function `rollapply()` will be replacing a `NA` value with the most recent non-`NA` value. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "‘zoo’ series from 2016-11-21 to 2016-11-30\n",
       "  Data: num [1:10] 48.1 48.3 48.6 NA 48.9 ...\n",
       "  Index:  POSIXlt[1:10], format: \"2016-11-21\" \"2016-11-22\" \"2016-11-23\" \"2016-11-24\" \"2016-11-25\" ...\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAeAAAAHgCAMAAABKCk6nAAAC91BMVEUAAAACAgIDAwMEBAQFBQUG\nBgYHBwcICAgJCQkKCgoLCwsMDAwODg4PDw8QEBARERESEhITExMUFBQVFRUWFhYXFxcYGBgZGRka\nGhobGxscHBwdHR0eHh4fHx8gICAhISEiIiIjIyMkJCQlJSUmJiYnJycoKCgqKiorKyssLCwtLS0u\nLi4vLy8wMDAxMTEyMjIzMzM0NDQ1NTU2NjY3Nzc4ODg5OTk6Ojo7Ozs8PDw9PT0+Pj4/Pz9AQEBB\nQUFCQkJDQ0NERERFRUVGRkZHR0dISEhJSUlKSkpLS0tMTExNTU1OTk5PT09QUFBRUVFSUlJTU1NU\nVFRVVVVWVlZXV1dYWFhZWVlaWlpbW1tcXFxdXV1eXl5fX19gYGBhYWFiYmJjY2NkZGRlZWVmZmZn\nZ2doaGhpaWlqampra2tsbGxtbW1ubm5vb29wcHBxcXFycnJzc3N0dHR1dXV2dnZ3d3d4eHh5eXl6\nenp7e3t8fHx9fX1+fn5/f3+AgICBgYGCgoKDg4OEhISFhYWGhoaHh4eIiIiJiYmKioqLi4uMjIyN\njY2Ojo6Pj4+QkJCRkZGSkpKTk5OUlJSVlZWWlpaXl5eYmJiZmZmampqbm5ucnJydnZ2enp6fn5+g\noKChoaGioqKjo6OkpKSlpaWmpqanp6eoqKipqamqqqqrq6usrKytra2urq6vr6+wsLCxsbGysrKz\ns7O0tLS1tbW2tra3t7e4uLi5ubm6urq7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nzDotRIr00FUSp472OMvZ7QeF43xlY2uzH9IHvlAeZty/cFUD2IOsHR\nBgQTB4KJA8HEgWDiQDBxIJg4EEwcCCYOBBMHgokDwcSBYOJAMHEgmDgQTBwIJg4EEweCifP/tpvq\nYOFeifcAAAAASUVORK5CYII=\n"
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%%R\n",
    "str(temp)\n",
    "plot(temp, type = c(\"l\"))\n",
    "points(temp)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Just based on the plot there is a huge chunk that is missing..."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAeAAAAHgCAIAAADytinCAAAgAElEQVR4nO3de0DN9/8H8Nc5XZVK\n15OSFJWkuVRSUUnl2h2RYRMtt9nYpq/NZPMb2+zKNmPuM0IsMnLPWrk0LIpERdIFXZTunfP74+zb\n12gonc/7c855Pv46fZzzeT/fY08fn/P5fN4CiURCAADAP0LWAQAAoHUoaAAAnkJBAwDwFAoaAICn\nUNAAADyFggYA4CkUNAAAT6GgAQB4CgUNAMBTKGgAAJ5CQQMA8BQKGgCAp1DQAAA8hYIGAOApFDQA\nAE+hoAEAeAoFDQDAUyhoAACeQkEDAPAUChoAgKdQ0AAAPIWCBgDgKRQ0AABPoaABAHgKBQ0AwFMo\naAAAnkJBAwDwFAoaAICnUNAAADyFggYA4CkUNAAAT6GgAQB4CgUNAMBTKGgAAJ5CQQMA8BQKGgCA\np1DQAAA8hYIGAOApFDQAAE+hoAEAeAoFDQDAUyhoAACeQkEDAPAUChoAgKdQ0AAAPIWCBgDgKRQ0\nAABPcVrQEomkqqpKIpFwOSgAgJzioqDr6+uXLl1qa2uroaGhq6urrq5uY2MTGxvb0NDAwegAAHKK\ni4KOiorKyMjYtGlTSUlJY2NjaWnptm3bsrOzo6OjORgdAEBOCTg44WBsbFxQUKCpqfn4xub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BAwDwFAoaAICnUNAAADyFggYA4CkUNAAA\nT6GgAQB4CgUNAMBTKGgAAJ5CQQMA8BQKGgCAp1DQAAA8hYIGAOApFDQAAE+hoAEAeOr/AQerWZ8w\nF/EDAAAAAElFTkSuQmCC\n"
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%%R\n",
    "\n",
    "# we define the forward function here\n",
    "forwardfun <- function(v, n){\n",
    "    if(is.na(v[n])){\n",
    "        return(v[max(which(!is.na(v)))])\n",
    "    } else {\n",
    "        return(v[n])\n",
    "    }\n",
    "}\n",
    "maxconsec <- 3\n",
    "\n",
    "forwardrep <- rollapply(temp,\n",
    "                       width = maxconsec,\n",
    "                       FUN = forwardfun,\n",
    "                       n = maxconsec,\n",
    "                       by.column = TRUE,\n",
    "                       align = \"right\")\n",
    "plot(temp, type = c(\"l\"))\n",
    "points(temp)\n",
    "lines(forwardrep, type = c(\"l\"), col = \"red\")\n",
    "points(forwardrep, col = \"red\")\n",
    "legend(\"bottomleft\", pch = c(1,1), col = c(\"black\",\"red\"), legend = c(\"Missing\",\"Forward Replacement\"))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Linearly Smoothed Replacement"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In a linear smoothed replacement (basically a linear interpolation) scheme, the `maxconsec` variable must be odd and greater than the max number of consecutive NAs plus two. Since in the top we have 2 consecutive NAs as the max, 2+2+1 = 5. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAeAAAAHgCAIAAADytinCAAAgAElEQVR4nO3deUDM+f8H8NfMdFDS\n3UQ5imqTWVJJlw7J3Sn3ZsmRY7H2u7R2rVjfZRfftZaVddsDkYRd27ppy7VYRyQSRSIdW+me+f0x\n++vblxYx83l/Zub5+Gv6NDPv51s8+3jP5xDIZDICAAD+EbIOAAAATUNB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0dGRiBYsWDBkyBAi2rdvX9++fX18fIho0aJFpqamMplMIBCsXbt28ODBAoEgNTWV6TxAo6Gg\nQT2ZmJjIHwgEAvmDhw8furm5yR937NhR/iA3N/fQoUMSiaRhe1FRkampadeuXTt37mxmZmZlZcVp\nboBGUNCgnhp6uUHbtm3v3r0rf5ybmyt/IBaLhwwZsmnTJiKSSqVZWVmmpqZEdPLkyUePHt24cePy\n5ctvv/02h8EB/gtr0KApwsPD161bl5WVVVVVtXjxYnmDDxw4cP/+/ZcuXaqrq/viiy8mTJhARDU1\nNVOmTPn2228XL148bdo01sFBc6GgQc0JBAL5IRl+fn4ffPBBQECAo6PjgAEDnJ2diah9+/YbN24c\nOXKkhYXF4cOHt23bRkRffvmlm5ubt7f32LFja2pq5BsBuCeQyWSsMwAAQBOwBw0AwFMoaAAAnkJB\nAwDwFAoaAICnUNAAADyFggYA4CkUNAAAT6GgAQB4CgUNAMBTKGgAAJ5CQQMA8BQKGgCAp1DQAAA8\nhYIGAOApFDQAAE+hoAEAeAoFDQDAUyhoAACe+j+tv9kJdNs0NgAAAABJRU5ErkJggg==\n"
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%%R\n",
    "# linear smoothed replacement function\n",
    "\n",
    "linearfun <- function(v, n){\n",
    "    m <- (n + 1)/2\n",
    "    if(is.na(v[m])){\n",
    "        a <- max(which(!is.na(v) & seq(1:n) < m))\n",
    "        b <- min(which(!is.na(v) & seq(1:n) > m))\n",
    "        return(((b-m)/(b-a)) * v[a] + ((m-a)/(b-a)) * v[b])\n",
    "    } else {\n",
    "        return(v[m])\n",
    "    }\n",
    "}\n",
    "\n",
    "maxconsec <- 5\n",
    "linearrep <- rollapply(temp, width = maxconsec, FUN = linearfun, n = maxconsec, by.column = TRUE, align = \"center\")\n",
    "\n",
    "plot(temp, type = c(\"l\"))\n",
    "points(temp)\n",
    "lines(linearrep, type = c(\"l\"), col = \"red\")\n",
    "points(linearrep, col = \"red\")\n",
    "legend(\"bottomleft\", pch = c(1,1), col = c(\"black\",\"red\"), legend = c(\"Missing\",\"Linearly Smoothed\"))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Volume-Weighted Smoothed Replacement"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In addition to the linear smoothing based on the value according to the `maxconsec`, weighting the values of the previous and post `NA` values according to the volume introduces another complexity that may better represent the `NA` values."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [],
   "source": [
    "%%R\n",
    "voltemp <- c(DATA[[\"Volume\"]][index(DATA[[\"Close\"]]) %in% c(index(temp)[1:3]), \"KORS\"],\n",
    "            zoo(NA, order.by = index(temp)[4]),\n",
    "            DATA[[\"Volume\"]][index(DATA[[\"Close\"]]) %in% c(index(temp)[5]), \"KORS\"],\n",
    "            zoo(NA, order.by = index(temp)[6:7]),\n",
    "            DATA[[\"Volume\"]][index(DATA[[\"Close\"]]) %in% c(\"2016-11-28\",\"2016-11-29\",\"2016-11-30\"), \"KORS\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAeAAAAHgCAIAAADytinCAAAgAElEQVR4nOzdeVxN+f8H8Pfttqi0\nLzfZKipJY6mkTYtKtvYs2YYImbHNUGMYmfHDjGUwGetYx1KkskfWaRQaW0SiopJMUirt3d8fd/SN\nkq3Oucvr+dft3HPv53XweHd8zjnvD4fP5xMAAAgfKbYDAABA01CgAQCEFAo0AICQQoEGABBSKNAA\nAEIKBRoAQEihQAMACCkUaAAAIYUCDQAgpFCgAQCEFAo0AICQQoEGABBSKNAAAEIKBRoAQEihQAMA\nCCkUaAAAIYUCDQAgpFCgAQCEFAo0AICQQoEGABBSKNAAAEIKBRoAQEihQAMACCkUaAAAIYUCDQAg\npFCgAQCEFAo0AICQQoEGABBSKNAAAEIKBRoAQEihQAMACCkUaA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17Yzw2NmYM4uPjy8rKOjs7RUTX9WAw6HA4ROTRo0efPn0a\nHR0dHh7evn27hQsH/sQeNFaKioqKtra2YDA4Ozvb1NRkNHhJSUlvb+/z58/D4fD58+ePHj0qInNz\nczU1Na2trU1NTbW1tdFeOFYuChrLnKZpxiUZ+fn5J0+e3LNnT1pams/ny8zMFJHk5OSOjo6DBw/G\nxcXdv3+/q6tLRJqbm71e7+7du6urq+fm5oyDgPW0hYWFaK8BAPATnEEDgKIoaABQFAUNAIqioAFA\nURQ0ACiKggYARVHQAKAoChoAFEVBA4CiKGgAUBQFDQCKoqABQFEUNAAoioIGAEVR0ACgKAoaABRF\nQQOAoihoAFDUd4x35IBGlIsHAAAAAElFTkSuQmCC\n"
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%%R\n",
    "volfun <- function(v, n, vol) {\n",
    "    m <- (n + 1)/2\n",
    "    if(is.na(v[m])){\n",
    "        a <- max(which(!is.na(v) & seq(1:n) < m))\n",
    "        b <- min(which(!is.na(v) & seq(1:n) > m))\n",
    "        return(((v[a] + ((m-a-1)/(b-a)) * (v[b] - v[a])) * vol[a] + \n",
    "                (v[a] + ((m-a+1)/(b-a)) * (v[b] - v[a])) * vol[b]) /\n",
    "                (vol[a] + vol[b]))\n",
    "    } else {\n",
    "        return(v[m])\n",
    "    }\n",
    "}\n",
    "maxconsec <- 5\n",
    "volrep <- rollapply(cbind(temp, voltemp), width = maxconsec, FUN = function(v) volfun(v[,1], n = maxconsec, v[,2]),\n",
    "                    by.column = FALSE, align = \"center\")\n",
    "\n",
    "plot(temp, type = c(\"l\"))\n",
    "points(temp)\n",
    "lines(linearrep, type = c(\"l\"), col = \"red\")\n",
    "points(linearrep, col = \"red\")\n",
    "lines(volrep, type = c(\"l\"), col = \"blue\")\n",
    "points(volrep, col = \"blue\")\n",
    "legend(\"bottomleft\", pch = c(1,1,1), col = c(\"black\",\"red\",\"blue\"), legend = c(\"Missing\",\"Linearly Smoothed\", \"Volume Weighted\"))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
